<div class="open-form">
    <div class="open-model">
        <div class="open-auto">
            <button class="layui-btn" id="isCheckFun" style="border-radius: 4px;margin-bottom: 10px">确认选择</button>
            <table id="orderDetailProductFormTable"></table>
        </div>
        <div class="layui-form-item text-right">
            <button class="layui-btn layui-btn-primary" type="button" ew-event="closeDialog">关闭</button>
        </div>
    </div>
</div>
<script>
    layui.use(['layer', 'form', 'table', 'admin', 'upload', 'tree', 'laytpl'], async function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var config = layui.config;
        const nowData = {...parentData};
        let cacheList = nowData.cacheList;
        let orderId = nowData.orderId;
        table.render({
            elem: '#orderDetailProductFormTable',
            url: config.base + `warehouse/warehouse/orderDetail/list`,
            where: {notInListIds: nowData.notInListIds ,orderId: orderId},
            page: true,
            cellMinWidth: 100,
            cols: [[
                {type: 'checkbox', fixed: 'left'}
                ,{field: 'productCode', title: '客户产品料号编码', align: 'center'}
                ,{field: 'productName',title: '客户产品名称', align: 'center'}
                ,{field: 'productSpecCode', title: '客户规格码', align: 'center'}
                ,{field: 'productType', title: '产品类型' , align: 'center'}
                ,{field: 'productCategory', title: '所属分类' , align: 'center'}
                ,{field: 'productProducer', title: '厂家' , align: 'center'}
                ,{field: 'productMark', title: '牌号' , align: 'center'}
                ,{field: 'productMainUnit', title: '计量单位' , align: 'center'}
                ,{field: 'width', title: '宽度mm' , align: 'center'}
                ,{field: 'length', title: '长度mm' , align: 'center'}
                ,{field: 'diameter', title: '厚度mm' , align: 'center'}
                ,{field: 'netWeight', title: '净重' , align: 'center'}
                ,{field: 'grossWeight', title: '毛重' , align: 'center'}
                ,{field: 'customer', title: '所属客户' , align: 'center'}
            ]],
        });
        $('#isCheckFun').click(() => {
            var checkStatus = table.checkStatus('orderDetailProductFormTable');
            var data = checkStatus.data;  // 选中的数据
            if (typeof parent.layui !== 'undefined') {
                childData.list = data.map(v => {
                    v.productDetailId = v.id;
                    v.warehousePrice = v.price;
                    delete v.id
                    return v
                })
                console.log('childData', data)
                layer.close(parentData.zindex); // 关闭指定的弹窗
            }
        })

    })
</script>